cc_library(
    name = "test_helpers",
    srcs = ["src/load_test_meshes.cpp"],
    hdrs = glob(["include/*.h"]),
    defines = ["GC_TEST_ASSETS_ABS_PATH=%s" % json.encode("\"test/assets\"")],
    includes = ["."],
    strip_include_prefix = "include",
    deps = [
        "//:surface",
        "@googletest//:gtest",
    ],
)

cc_test(
    name = "tests_with_assets",
    srcs = [
        "src/eigen_interop_helpers_test.cpp",
        "src/halfedge_geometry_test.cpp",
        "src/halfedge_mesh_test.cpp",
        "src/halfedge_mutation_test.cpp",
        "src/intrinsic_triangulation_test.cpp",
        "src/linear_algebra_test.cpp",
        "src/stl_reader_test.cpp",
        "src/surface_misc_test.cpp",
    ],
    data = [
        "//test/assets",
    ],
    deps = [
        ":test_helpers",
        "//:numerical",
        "//:pointcloud",
        "//:surface",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "tests_without_assets",
    srcs = [
        "src/point_cloud_test.cpp",
        "src/poisson_disk_sampler_test.cpp",
    ],
    defines = ["GC_TEST_ASSETS_ABS_PATH=%s" % json.encode("\"unused\"")],
    deps = [
        ":test_helpers",
        "//:numerical",
        "//:pointcloud",
        "//:surface",
        "@googletest//:gtest_main",
    ],
)
